import { Switch } from 'antd'
import { useEffect, useState } from 'react'

//布尔开关
export default (props) => {
  const {onChange, value} = props;
  useEffect(()=>{}, [value])
  const update = (v) => {
    onChange(v ? 1 : 0)
  }
  return <Switch checkedChildren="是" checked={value=='1'} onChange={update} unCheckedChildren="否" />
}
